</div>
<?php
if(isset($_success) && $_success)
{
foreach($_success as $succes) { ?>
<div data-toggle="notify" data-onload data-message="<?php echo $succes;?>" data-options="{&quot;status&quot;:&quot;success&quot;}" class="hidden-xs"></div>
<?php 
}
}
 ?>

<?php
if(isset($_errors) && $_errors)
{
 foreach($_errors as $error) { ?>
<div data-toggle="notify" data-onload data-message="<?php echo $error;?>" data-options="{&quot;status&quot;:&quot;danger&quot;}" class="hidden-xs"></div>
<?php 
}
 ?>
<?php } ?>

<div id="delete" class="modal fade">
		<div class="modal-dialog">
			<div class="modal-content">
				<div class="modal-header">
					<button data-dismiss="modal" class="close" type="button">×</button>
					<h3>Xác nhận xóa</h3>
				</div>
				<div class="modal-body">
					<p>Bạn có chắc chắn muốn xóa</p>
				</div>
				<input type="text" value="" class="input_url_delete hide">
				<input type="text" value="" class="input_id_delete hide">
				<div class="modal-footer">
					<a data-dismiss="modal" class="btn btn-primary btn-small ajax" href="#">Confirm</a>
					<a data-dismiss="modal" class="btn btn-default btn-small" href="#">Cancel</a>
				</div>
			</div>
		</div>
</div>
<script type="text/javascript" charset="utf-8">
    $(document).ready(function() {
	$('.ajax').click(function(e){
	var url_delete = $(".input_url_delete").val();
	var id_delete = $(".input_id_delete").val();
	jQuery.ajax({
		type:"POST",
		url: url_delete,
		data: "",
		success:function(response){
				if(response.length < 2){
					 $( "#"+id_delete+"> td").css("background-color", "#ff0");
						$( "#"+id_delete+"> td").fadeOut( "slow");
					}
					else{
					alert(response);
					}
		}
	});
    });
	$('.delete').click(function(e){
		var url = $(this).attr("rel_url");
		$(".input_url_delete").val(url);
		$(".input_id_delete").val($(this).attr("rel_id"));
    });
    });

if($('.upload-ajax-file').length)
{
	$('.upload-ajax-file').each(function( index ) {
		txt(this);
	});
}
</script>
 <!-- App Main-->
   <script src="<?php echo admin_theme_url();?>js/app.js"></script> 
   
    <script>
    $('select.select2').select2();
   function format(state) {
   var originalOption = state.element;
      if (!state.id) return state.text; // optgroup
      return "<img class='game_keyins' src='"+base_url+"template/images/key/key_" + state.id.toLowerCase() + ".gif' /> " + state.text;
      
   }
   $("select.select").select2({
      formatResult: format,
      formatSelection: format,
      escapeMarkup: function(m) { return m; }
   });
   
   </script>
   
</body>
</html>
